$(function () {
	
	"use strict";
	 
	 $('#specialCrowdSel').multiselect({
	 	includeSelectAllOption: true,
	 	buttonWidth: '150px'
	 });
	 
	 $('#isInjuredSel').multiselect({
	 	includeSelectAllOption: true,
	 	buttonWidth: '150px'
	 });

	$('#search').on('click', function (e) {
		e.preventDefault();
		searchOrder();
	});
	
	$('#create').on('click', function (e) {
		e.preventDefault();
		window.location.href="./jsp/aricle/linkAricleEdit.jsp";
	});
	
});


function save(){
	var title=$("#title").val();
	var linkAricle=$("#linkAricle").val();
	var organization=$("#organization").val();
	var source=$("#source").val();
	if(title==""){
		alert("标题不能为空");
		return;
	}else if(linkAricle==""){
		alert("文章链接不能为空");
		return;
	}else if(organization==""){
		alert("所属机构不能为空");
		return;
	}else if(source==""){
		alert("来源公众号不能为空");
		return;
	}else{
		$.ajax({
		       url: basePath+"linkAricle/toSaveLinkAricle",
		       type: "POST",
		       data:{
		    	   title:title,
		    	   linkAricle:linkAricle,
		    	   organization:organization,
		    	   source:source
		       },
		       dataType: 'json',
		       cache: false,
		       success: function (ret) {
		    	   if(ret.resultCode==0){
		    		   alert("保存成功");
		    	   }else{
		    		   alert("保存失败");
		    	   }
	    		   var listurl=basePath+"jsp/aricle/linkAricleList.jsp";
	    		   window.location.href=listurl;
		       }
	});
	}
	
}
